package test;

import dao.FlowerDaoImpl;
import entity.Flower;

import java.util.List;

public class main {
    public static void main(String[] args) {
        FlowerDaoImpl flowerDao = new FlowerDaoImpl();

        // 查询所有花卉
        List<Flower> flowers = flowerDao.getAllFlowers();
        for (Flower flower : flowers) {
            System.out.println(flower);
        }

        // 添加花卉
        Flower newFlower = new Flower();
        newFlower.setName("牡丹");
        newFlower.setAnothername("富贵花");
        newFlower.setProperty("芍药科");
        newFlower.setPrice(10.5f);
        newFlower.setProduction("中国");

        boolean added = flowerDao.addFlower(newFlower);
        System.out.println("添加结果：" + added);
    }
}
